
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
    String path =request.getContextPath();
    String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<html>

<link rel="stylesheet" href="<%=basePath%>resources/css/font.css">
<link rel="stylesheet" href="<%=basePath%>resources/css/xadmin.css">
<script src="<%=basePath%>resources/lib/layui/layui.js" charset="utf-8"></script>
<script type="text/javascript" src="<%=basePath%>resources/js/xadmin.js"></script>
<!--[if lt IE 9]>
<script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
<script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->

<%--富文本--%>
<link rel="stylesheet" href="http://www.jq22.com/jquery/bootstrap-3.3.4.css">
<link href="<%=basePath%>resources/dist/summernote.css" rel="stylesheet"/>
<script src="http://www.jq22.com/jquery/jquery-1.10.2.js"></script>
<script src="http://www.jq22.com/jquery/bootstrap-3.3.4.js"></script>
<script src="<%=basePath%>resources/dist/summernote.js"></script>
<script src="<%=basePath%>resources/dist/lang/summernote-zh-CN.js"></script>

<head>
    <title>富文本编辑器</title>
</head>
<body>
<a type="button" type="button" class="layui-btn" href="<%=basePath%>Department/department">
    返回
</a>
<a type="button" class="layui-btn" onclick="updateNote(${department_id})">
    确定修改
</a>
<div class="summernote">
        ${department_note}
</div>
</body>
<script>
        $(function(){
            $('.summernote').summernote({
                height: 800,
                tabsize: 2,
                lang: 'zh-CN'
            });
        })
        function updateNote(department_id){
            var d_note = $('.summernote').summernote('code');
            <%--location.href="<%=basePath%>user/updateNote?d_note="+d_note+"&department_id=${department_id}";--%>
            $.ajax({
                url : "<%=basePath%>Department/updateNote?d_note="+d_note+"&department_id="+department_id,
                // type : "get",
                // dataType : "json",
                // data:d_note,
                success : function (data){
                    if(data.flag){
                        location.href="<%=basePath%>Department/department";
                    }
                }
            })
        }
</script>
</html>
